package com.linked.goods.goodsbase.bean.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linked.goods.goodsbase.bean.dto.GoodsKindDTO;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author :dbq
 * @date : 2023/5/19 9:38
 * @description : desc
 */
@Data
@TableName("goods_goods_kind")
public class GoodsKindPO {

    /**
     * 商品种类表
     */
    @TableId(value = "goods_kind_id", type = IdType.ASSIGN_UUID)
    private String goodsKindId;

    /**
     * 种类父id
     */
    @TableField("kind_pid")
    private String kindPid;

    /**
     * 是否有子种类。1、有;0、没有
     */
    @TableField("if_sonKind")
    private Integer ifSonKind;

    /**
     * 种类名称
     */
    @TableField("kind_name")
    private String kindName;

    /**
     * 种类排序
     */
    @TableField("kind_order")
    private Integer kindOrder;



    /**
     * create_time
     */
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * data_status
     */
    @TableField("data_status")
    private Integer dataStatus;

    public GoodsKindPO(GoodsKindDTO param) {
        this.kindName = param.getKindName();
        this.kindOrder = param.getKindOrder();
        this.kindPid = param.getKindPid();
    }

    public GoodsKindPO() {
    }
}
